<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>数据双向绑定</title>
</head>
<body>
  
</body>
<script>
  var Book = {};
  var name = "";
  Object.defineProperty(Book, "name", {
    get: function() {
      return "《" + name + "》";
    },
    set: function(value) {
      // set里面要实现数据更新
      console.log(value, '1111111111');
      name = value; // 赋值
    }
  })

  Book.name = "js基础123";
  console.log(Book.name)
</script>
</html>